package cn.edu.cdut.controller;

import cn.edu.cdut.dto.MyRes;
import cn.edu.cdut.dto.User;
import cn.edu.cdut.service.LoginService;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Author  kobe
 * Created on 2017-05-26-14:37
 */
@RestController
public class LoginController {

        @Autowired
        private LoginService loginService;

        //登录
        @PostMapping("/login")
        public MyRes login(@RequestBody User user) {
                String userId = user.getUserId();
                String password = user.getPassword();
                return loginService.login(userId, password);
        }
}
